Skip to content

Fix docs DX: consistent patterns, narrative guides, CI smoke tests#77

Merged
Larry-Osakwe merged 1 commit intomainfrom
larry/docs-dx-overhaul
Feb 24, 2026
Merged

Fix docs DX: consistent patterns, narrative guides, CI smoke tests#77
Larry-Osakwe merged 1 commit intomainfrom
larry/docs-dx-overhaul

Conversation

@Larry-Osakwe
Copy link
Contributor

@Larry-Osakwe Larry-Osakwe commented Feb 24, 2026

Summary

  • Root README rewrite — added value prop, "Which Package?" decision table, correct code patterns for both keycardai-mcp and keycardai-mcp-fastmcp, removed ~300 lines of redundant setup instructions
  • Docs MDX → narrative-only guides — removed duplicated code blocks from mcp-server-auth.mdx, fastmcp-integration.mdx, and mcp-client-usage.mdx; they now explain concepts and link to the canonical package examples. Renamed nav group from "Examples" to "Guides"
  • Bug fixes — added missing ctx: Context parameter to packages/mcp/examples/delegated_access/main.py (the @grant decorator requires both AccessContext and Context); fixed stale AccessContext = None docstring in provider.py; fixed accessauth_provider naming in packages/mcp/README.md
  • CI smoke tests — added test_examples.py to all 3 packages that import each example via importlib and verify expected objects exist. The @grant decorator validates function signatures at import time, so these catch parameter bugs like Ellie's report. FastMCP tests mock DefaultClientFactory to prevent real HTTP calls during AuthProvider.__init__

Context

Customer (Ellie) reported that docs/examples/mcp-server-auth.mdx showed access_ctx: AccessContext = None which doesn't match the actual API. Root cause: code was duplicated in MDX files and drifted from the package examples. This PR fixes the immediate bugs and makes the drift structurally impossible going forward.

Test plan

  • packages/oauth — 104 passed
  • packages/mcp — 623 passed, 16 skipped (interactive tests)
  • packages/mcp-fastmcp — 51 passed
  • CI (just test-coverage) should pass with no coverage regressions

@Larry-Osakwe Larry-Osakwe force-pushed the larry/docs-dx-overhaul branch from 1d431d4 to d65f707 Compare February 24, 2026 00:15
Customer reported broken AccessContext patterns in docs — this overhaul
fixes the root cause (duplicated code in MDX files) and adds CI
guardrails so examples can't silently drift from the SDK API again.

- Rewrite root README with value prop, decision table, correct patterns
- Convert docs/ MDX files to narrative-only guides (no code duplication)
- Fix delegated_access example: add missing ctx: Context parameter
- Fix stale AccessContext = None docstring in provider.py
- Add smoke tests for all package examples (mcp, mcp-fastmcp, oauth)
- Rename docs nav group from "Examples" to "Guides"
@Larry-Osakwe Larry-Osakwe force-pushed the larry/docs-dx-overhaul branch from d65f707 to 0229a79 Compare February 24, 2026 00:29
Copy link
Contributor

@mnoble mnoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. 👍

I love that you added tests for the examples, but they are pretty useless, imo 😕. Only testing that the module has certain properties, and none of the logic within, doesn't really do much.

Not a blocker right now, but it'd be nice to flesh them out in the future to ensure our examples are legit.

@Larry-Osakwe Larry-Osakwe merged commit adbe2d8 into main Feb 24, 2026
6 checks passed
@Larry-Osakwe Larry-Osakwe deleted the larry/docs-dx-overhaul branch February 24, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants